﻿Imports DevExpress.Web.ASPxScheduler
Imports DevExpress.XtraScheduler
Imports SIAVU.Dominio

Partial Public Class ucCustomAppointmentTemplate
    Inherits System.Web.UI.UserControl

    Private ReadOnly Property Container() As HorizontalAppointmentTemplateContainer
        Get
            Return DirectCast(Me.Parent, HorizontalAppointmentTemplateContainer)
        End Get
    End Property

    Private ReadOnly Property Appointment() As Appointment
        Get
            Return DirectCast(Container.AppointmentViewInfo.Appointment, Appointment)
        End Get
    End Property


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        AgregarImagenFondoAppointment(Me.Appointment, Me.Container.AppointmentViewInfo)
    End Sub

    Private Sub AgregarImagenFondoAppointment(ByRef oAppointment As Appointment, ByRef oTimeLineAppointmentViewInfo As DevExpress.Web.ASPxScheduler.Drawing.TimeLineAppointmentViewInfo)
        'Select Case oAppointment.LabelId
        '    Case ETipoActividad.Posta
        '        oTimeLineAppointmentViewInfo.AppointmentStyle.BackgroundImage.ImageUrl = "~/Imagenes/WhitePlain.png"
        '        oTimeLineAppointmentViewInfo.AppointmentStyle.BackgroundImage.HorizontalPosition = "left"
        '        oTimeLineAppointmentViewInfo.AppointmentStyle.BackgroundImage.VerticalPosition = "top"
        '        oTimeLineAppointmentViewInfo.AppointmentStyle.BackgroundImage.Repeat = DevExpress.Web.ASPxClasses.BackgroundImageRepeat.NoRepeat
        '    Case ETipoActividad.DiaLibre
        '        oTimeLineAppointmentViewInfo.AppointmentStyle.BackgroundImage.ImageUrl = "~/Imagenes/YellowSmile.png"
        '        oTimeLineAppointmentViewInfo.AppointmentStyle.BackgroundImage.HorizontalPosition = "center"
        '        oTimeLineAppointmentViewInfo.AppointmentStyle.BackgroundImage.VerticalPosition = "top"
        '        oTimeLineAppointmentViewInfo.AppointmentStyle.BackgroundImage.Repeat = DevExpress.Web.ASPxClasses.BackgroundImageRepeat.NoRepeat
        'End Select
    End Sub

End Class